<!-- 历史负荷 天 -->
<template>
	<view>
		<u-calendar v-model="showCalendar " mode="date"  @change="dateChange"></u-calendar>
		<view class="histit">
			A区-五号楼 I 4-3号箱式变压箱
		</view>
		
		<view class="datapiker" @click="showCalendar=true">
			<text>{{byDate}}</text>
			<u-icon name="arrow-down"></u-icon>
		</view>
		<view class="page">
			<block v-for="(item,index) in dataList" :key="index">
				<view class="jctit">
					{{item.enterprise}}
				</view>
				
				<view class="xb-three-box">
					<view>
						<text>申报容量（kv）</text>
						<text>{{item.enAllow}}</text>
					</view>
					<view>
						<text>线路</text>
						<text>线径</text>
						<text>负荷监测（kv)</text>
					</view>
					<view>
						<text>{{item.partId}}</text>
						<text>{{item.diameter}}</text>
						<text>{{item.value}}</text>
					</view>
				</view>
			</block>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				byDate:'2021-10-14',
				showCalendar:false,
				dataList:[]
			};
		},
		onLoad(e) {
			this.byDate= e.checkTime
			this.apis.energyApi.nyTransDay({id:e.id,checkTime:this.byDate}).then(res=>{
				this.dataList=res.rows	
			})
		},
		methods:{
			dateChange(e){
				console.log(e);
				this.byDate=e.result
				this.apis.energyApi.nyTransDay({id:e.id,checkTime:this.byDate}).then(res=>{
					this.dataList=res.rows	
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		background-color: #fff;
	}

	.histit {
		margin-bottom: 20upx;
		width: 100%;
		height: 50upx;
		font-size: 28upx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #333333;
		@include flexCenter;
		background: #FFFFFF;
	}


	.jctit {
		box-sizing: border-box;
		margin: 0 32upx;
		font-size: 26upx;
		font-family: PingFang-SC-Medium, PingFang-SC;
		font-weight: 500;
		color: #666666;
		margin-bottom: 28rpx;

		.ts {
			padding-bottom: 30rpx;
			width: 100%;
			border-bottom: 1rpx solid #E5E5E5;
		}
	}

	.xb-three-box {
		box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.1);
	}
	/deep/ .u-calendar__action{
		display: flex;
		justify-content: center;
	}
	
	.datapiker{
		width: 100%;
		height: 90rpx;
		background-color: #fff;
		padding: 0 32rpx;
		display: flex;
		align-items: center;
		font-size: 28rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 600;
		color: #333333;
		text{
			margin-right: 10rpx;
		}
	}
</style>
